package com.zsgeek.wisdchain.qutu.GestureRecognition.UI;

import android.os.Bundle;


import com.zsgeek.wisdchain.qutu.BaseActivity;
import com.zsgeek.wisdchain.qutu.GestureRecognition.Weight.ChaosGestureView;
import com.zsgeek.wisdchain.qutu.R;
import com.zsgeek.wisdchain.qutu.base.event.PreferenceHelper;

import java.util.List;

import butterknife.BindView;

public class SettingPatternPswActivity extends BaseActivity implements ChaosGestureView.GestureCallBack {
    @BindView(R.id.gesture)
    ChaosGestureView gestureView;

    @Override
    public int getLayoutId() {
        return R.layout.activity_setting_pattern_psw;
    }

    @Override
    protected void initView() {
        setTitle(R.string.set_gesture_password);
        gestureView.setGestureCallBack(this);
        //不调用这个方法会造成第二次启动程序直接进入手势识别而不是手势设置
        gestureView.clearCache();
    }

    @Override
    protected void initDate(Bundle savedInstanceState) {
    }


    @Override
    public void onPointerCaptureChanged(boolean hasCapture) {

    }

    @Override
    public void gestureVerifySuccessListener(int stateFlag, List<ChaosGestureView.GestureBean> data, boolean success) {
        if (stateFlag == ChaosGestureView.STATE_LOGIN) {
            PreferenceHelper.putGestureFlag(true);
            finish();
        }
    }
}
